home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Interactive Reference Guide / C-C++ Interactive Reference Guide.iso / c_ref / csource2 / sclib_1 / 1_4 / v7n4033a.txt < prev    next >
Encoding:
Text File  |  1995-11-01  |  1008 b   |  30 lines

  1. /*                     Listing 2 -- File HEXIO.H                        */
  2. /*        Header File for Intel Hex / S-Record File I/O Routines        */
  3.  
  4. #include <stdio.h>
  5.  
  6. #define HEOF            (-1)    /*  This is our value for EOF.          */
  7.  
  8. #define HEXRECSIZE      32      /*  Max. number of data bytes per       */
  9.                                 /*      record on writes.               */
  10.  
  11. typedef struct {                /*  This is the control block that      */
  12.         FILE *file;             /*  actually runs hex file I/O.         */
  13.         unsigned char *bufp;
  14.         unsigned loadaddr;
  15.         unsigned char flags;
  16.         unsigned char count;
  17.         unsigned char buf[256];
  18. } HFILE;
  19.  
  20. /*  Function declarations:                                              */
  21.  
  22. int hclose(HFILE *);
  23. int heof(HFILE *);
  24. int herror(HFILE *);
  25. int hgetc(HFILE *);
  26. int hputc(unsigned char,HFILE *);
  27. unsigned htell(HFILE *);
  28. void hseek(HFILE *,unsigned);
  29. HFILE *hopen(char *,char *);
  30.